<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String date = format.format(new Date());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/carListPage.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CoachListPage.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/departmentListPage.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/cfmaintainitemList.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/repairshopList.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
    li span {
        margin-left: 0px;
        cursor: pointer;
    }

    li span:hover {
        color: #427dff
    }
    .copyDate:HOVER {
        cursor: pointer;
    }

    /**按钮样式**/
    .subtn1 {
        background: #57a0ff;
        border-radius: 50px;
        background: -webkit-linear-gradient(top, #57a0ff, #57a1ff);
        background: -moz-linear-gradient(top, #57a0ff, #57a1ff);
        background: linear-gradient(top, #57a0ff, #57a1ff);
        background: -ms-linear-gradient(top, #57a0ff, #57a1ff);
        border: 1px solid #2576A8;
        box-shadow: 0 1px 2px #8AC1E2 inset, 0 -1px 0 #57a0ff inset;
        color: #fff;
        height: 40px;
        text-shadow: 1px 1px 0.5px #22629B;
        outline: none;
    }

    .btn {
        background: #57a0ff, background;
        border-radius: 50px;
        background: -webkit-linear-gradient(top, #57a0ff, #57a1ff);
        background: -moz-linear-gradient(top, #57a0ff, #57a1ff);
        background: linear-gradient(top, #57a0ff, #57a1ff);
        background: -ms-linear-gradient(top, #57a0ff, #57a1ff);
        border: 1px solid #2576A8;
        box-shadow: 0 1px 2px #8AC1E2 inset, 0 -1px 0 #57a0ff inset;
        color: #fff;
        height: 40px;
        text-shadow: 1px 1px 0.5px #22629B;
        outline: none;
    }

    .subtn1:hover {
        background: -webkit-linear-gradient(top, #8DC9EF, #4E9FD1);
        background: -moz-linear-gradient(top, #8DC9EF, #4E9FD1);
        background: linear-gradient(top, #8DC9EF, #4E9FD1);
        background: -ms-linear-gradient(top, #8DC9EF, #4E9FD1);
    }

    .btn:hover {
        background: -webkit-linear-gradient(top, #8DC9EF, #4E9FD1);
        background: -moz-linear-gradient(top, #8DC9EF, #4E9FD1);
        background: linear-gradient(top, #8DC9EF, #4E9FD1);
        background: -ms-linear-gradient(top, #8DC9EF, #4E9FD1);
    }

    .modal-data {
        visibility: hidden;
        z-index: 1001;
        width: 1000px;
        min-height: 500px;
        margin: 100px auto;
        background-color: #FFFFFF;
        /* border: 1px solid #C80B14;*/
        -moz-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
        -webkit-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
        /*         box-shadow:0 0 10px #cccccc;
                box-shadow: #cccccc; */
        box-shadow: 0 10px 20px #57a1ff inset, 0 -10px 0 #57a0ff inset;
        padding: 5px;
        text-align: center;
        position: fixed;
        left: 22%;
    }

    .modal-data1 td {
        padding-left: 15px;
        padding-right: 15px
    }

    .modal-data1 tr:FIRST-CHILD td {
        padding: 0px 10px;
    }

    .modal-data1 tr {
        padding-top: 30px
    }

    .modal-data1 form table {
        margin: 0px
    }

    input[type=checkbox] {
        padding: 0px;
        margin: 0px;
        text-align: right;
        width: 15px
    }

    .div_zilei {
        width: 600px;
        height: 30px
    }

    .tr {
        height: 40px;
        background: #57a0ff;
        font-weight:700
    }

    .tr td {
        font-size: 14px;
        color: #ffffff
    }

    .tr_td {
        height: 40px;
    }

    .tr_td td {
        border-bottom: 1px solid #ededed;
        text-align: center;
    }

    tr td:nth-child(1) {
        font-size: 14px;
        color: #cccccc
    }

    .date {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .tr_td td:nth-child(1) {
        border-left: 1px solid #cccccc;
    }

    .addTable.deleteTable:HOVER {
        cursor: pointer;
    }

    .fseq {
        width: 37px;
        border: 0;
        text-align: center;
        color: #cccccc
    }

    .jczl {
        padding-left: 100px;
    }

    .div_tj {
        margin-top: 40px;
        margin-left: 140px;
        padding-right: 60px;
    }

    .text {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .remuneration1 {
        width: 150px;
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .loading {
        margin: 100px 450px;
        display: block;
        width: 65px;
        height: 65px;
        border: 1px solid #ddd;
        border-radius: 5px;
        opacity: .7;
        background: url(../images/loading.gif) no-repeat;
    }

    .botton {
        float: left;
        margin-left: 80px;

    }

    .botton span {
        width: 80px;
    }

    .botton input {
        width: 230px;
    }

    span input {
        width: 120px;
    }

    .findBtn1 {
        margin-left: 50px;
    }

    select {
        width: 234px;
        height: 31px
    }

    .tr td {
        font-size: 14px;
        color: #ffffff
    }

    .tr_td {
        height: 40px;
    }

    .tr_td td {
        border-bottom: 1px solid #ededed;
        text-align: center;
    }

    tr td:nth-child(1) {
        font-size: 14px;
        color: #cccccc
    }

    .date {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .tr_td td:nth-child(1) {
        border-left: 1px solid #cccccc;
    }

    .tr_td td:nth-child(3) {
        border-right: 1px solid #cccccc;
    }

    .addTable.deleteTable:HOVER {
        cursor: pointer;
    }

    type[type='checkbox'] {
        width: 15px;
    }

    .div_zilei {
        height: 30px
    }

    .content_id {
        width: 800px;
        /* border: 2px solid #ccc;*/
        padding: 20px 80px 10px 80px;
        font-size: 18px;
        display: none;
    }

    #head {
        text-align: center;
        line-height: 40px;
        font-size: 28px;
        font-weight: bold;
    }

    .content_id .text1 table tr td {
        border: 1px solid #000000; /*细线表格线条颜色*/
        height: 40px;
        font-size: 18px;
        color: #000000;
    }

    .content_id .text1 table:nth-child(2) {
        border-top: none;
    }

    .content_id .text1 table:nth-child(2) tr td {
        border-top: none;
    }

    .content_id .text1 table {
        width: 100%;
        border: 1px solid #000000;
        border-collapse: collapse; /*细线表格代码*/
        text-align: center;
    }

    .content_id .text2 span {
        line-height: 60px;
        margin-left: 60%;
    }
    .div_input_hang {
        width: 100%;
        height: 40px;
    }
    .input_hang {
        float: left;
        width: 500px;
        height: 40px;
    }

</style>
<body style="background: #f5f5f5">

<div class="main">
    <div id="modal-overlay">

    </div>

    <div class="weizhi">
        <c:if test="${flag eq 1 }">
            车辆管理>>车辆维修>>新增
        </c:if>
        <c:if test="${Carmaintain.cfbillstate == 3}">
            教练管理>>车辆维修>>修改
        </c:if>
        <c:if test="${Carmaintain.cfbillstate == 4}">
            教练管理>>车辆维修>>查看
        </c:if>
        <c:if test="${Carmaintain.cfbillstate == 5}">
            教练管理>>车辆维修>>查看
        </c:if>
    </div>
    <div class="div_body" style="min-height: 900px;">

        <div class="content_id">
            <div id="head">
                <span>${Carmaintain.carmaintainentryList[0].cfrepairshopName}</span>
                <br/>
                <span>结 算 单</span>
            </div>
            <div class="text1">
                <table>
                    <tr>
                        <td>车号</td>
                        <td>${Carmaintain.cfcarName}</td>
                        <td>车型</td>
                        <td>${Carmaintain.carName}</td>
                    </tr>
                    <tr>
                        <td>业务日期</td>
                        <td>${Carmaintain.fbizdate}</td>
                        <td>出厂时间</td>
                        <td></td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td colspan="2">维修项目</td>
                        <td>材料数量</td>
                        <td>材料单价</td>
                        <td>材料金额</td>
                        <td>工时数量</td>
                        <td>工时单价</td>
                        <td>工时金额</td>
                        <td>小计</td>
                    </tr>
                    <c:forEach items="${Carmaintain.carmaintainentryList}" var="carmaintainentry"
                               varStatus="s">
                        <tr>
                            <td colspan="2">${carmaintainentry.cfmaintainitemName}</td>
                            <td class="dy_cfqty">${carmaintainentry.cfqty}</td>
                            <td class="dy_cfprice">${carmaintainentry.cfprice}</td>
                            <td class="dy_cfamount">${carmaintainentry.cfamount}</td>
                            <td class="dy_cfgsqty">${carmaintainentry.cfgsqty}</td>
                            <td class="dy_cfmanhours">${carmaintainentry.cfmanhours}</td>
                            <td class="dy_cfbasemanhours">${carmaintainentry.cfbasemanhours}</td>
                            <td class="dy_cfallamount">${carmaintainentry.cfallamount}</td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <td colspan="2">合计</td>
                        <td id="no_dy_cfqty"></td>
                        <td id="no_dy_cfprice"></td>
                        <td id="dy_cfamount"></td>
                        <td id="no_dy_cfgsqty"></td>
                        <td id="no_dy_cfmanhours"></td>
                        <td id="dy_cfbasemanhours"></td>
                        <td id="dy_cfallamount"></td>
                    </tr>
                </table>
            </div>
            <div class="text2">
                <span>客户签名：</span>
            </div>

        </div>
        <%--提示的隐藏标识--%>
        <input type="hidden" id="alertType" value="${alertType}">
        <c:if test="${flag eq 1 }">
            <div class="div_form">
                <form action="<%=path%>/DrivingSys/add_Carmaintain" onsubmit="StopRepeat()" id="update_shar"
                      class="form" method="get">
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input disabled='disabled' type="text" name="name" value="${department}" readonly="readonly"
                                   style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input type="text" name="fnumber" value="${fnumber}" style="color: gray;"
                                   readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="fbizdate_bind" value="${time}"
                                   onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"/>
                            <img onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"
                                 src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">车辆&nbsp;:&nbsp;</span>
                            <input name="carName" class="carName is_click" onclick='clickcar($(this))'/>
                            <input type="hidden" name="cfcarid" class="cfcarid">
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select name="cfbillstate">
                                <option style="color: gray;" value="3">保存</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">备注&nbsp;:&nbsp;</span>
                            <input name="fdescription"/>
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">部门&nbsp;:&nbsp;</span>
                            <input name="cfdepartmentName" class="is_click" onclick='clickdep($(this))'/>
                            <input type="hidden" name="cfdepartmentid" class="cfdepartmentid">

                        </div>
                        <div class="input_hang">
                            <span class="gn_name">维修类型&nbsp;:&nbsp;</span>
                            <select name="cfmaintetype">
                                <option style="color: gray;" value="1">正常维修</option>
                                <option style="color: gray;" value="2">事故维修</option>
                                <option style="color: gray;" value="3">公交车维修</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">教练&nbsp;:&nbsp;</span>
                            <input name="jlname" class="jlName is_click" onclick="clickJlname($(this))"/>
                            <input type="hidden" name="cfjiaolianid" class="cfcoachid">
                        </div>
                    </div>
                    <br>
                    <div style="width: 20%; margin-left: 90px; float: left">维修项目</div>
                    <div class="div_zilei" style="margin-left: 90px; float: left">
                        <div style="width: 60%;text-align: right;">
                            <img src="<%=path%>/image/insert2323.jpg" class="copyDate">
                            <span style="padding-right: 20px;color: #57a0ff;font-weight:700;font-size: 14px"
                                  class="copyDate">复制</span>
                            <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                            <span style="padding-right: 20px;color: #57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
                            <img src="<%=path%>/image/delete212.png" class="deleteTable">
                            <span class="deleteTable" style="color: #57a0ff;font-weight:700;font-size: 14px"
                                  class="deleteTable">删除</span>
                            <span style="cursor:pointer; padding-left: 40px;color: #57a0ff;font-weight:700;font-size: 14px"
                                  class="printTable" onclick="print_func()">打印</span>
                        </div>
                    </div>
                    <div style="overflow:auto;min-height: 274px;max-height: 274px;width: 88%;margin-left: 90px;">
                        <table id="tablejl" width="77%"
                               style="min-height:50px; max-height:300px;border-spacing:0;white-space:nowrap;">
                            <tr class="tr">
                                <td width="20px" align="center" style="padding-left: 5px"><%--<input type="checkbox"
                                                                                                 name="check"
                                                                                                 class="check"
                                                                                                 style="width: 15px;">--%>
                                </td>
                                <td width="30px">序号</td>
                                <td align="center">维修项目</td>
                                <td align="center">修理厂</td>
                                <td align="center">工时</td>
                                <td align="center">工时数量</td>
                                <td align="center">工时金额</td>
                                <td align="center">单价</td>
                                <td align="center">数量</td>
                                <td align="center">维修金额</td>
                                <td align="center">合计</td>
                                <td align="center">备注</td>
                            </tr>
                            <tr>
                                <td width='30px' align='center'>
                                    <input class='check2' type="checkbox" name="check2" style="width:15px">

                                </td>
                                <td><input type="text" class="fseq" name="fseq" value="1" readonly="readonly"></td>
                                <td style="position: relative;" name='notcheck' align='center'>
                                    <input class='cfmaintainitemName' style='width: 90px;' type='text'
                                           name='cfmaintainitemName' value=''/>
                                    <input type="hidden" name="cfmaintainitemid" class="cfmaintainitemid">
                                    <img onclick="cfminame2($(this))"
                                         style="cursor:pointer; width: 12px; height: 12px; position: absolute;right: 10px; top:10px;"
                                         src="<%=path%>/images/index/details_img.png" alt="">
                                </td>
                                <td name='notcheck' align='center'>
                                    <input class='cfrepairshopName is_click_ne' style='width: 140px;' type='text'
                                           name='cfrepairshopName' onclick="clickrep($(this))" value=''/>
                                    <input type="hidden" name="cfrepairshopid" class="cfrepairshopid">
                                </td>
                                <td align='center'>
                                    <input style='width: 90px;' type='text' class="cfmanhours"
                                           name='cfmanhours'
                                           value='0'/>
                                </td>
                                <td name='notcheck' align='center'>
                                    <input class='cfgsqty' style='width: 90px;' type='text' name='cfgsqty' value=''/>
                                </td>
                                <td align='center'>
                                    <input class='cfbasemanhours' readonly="readonly" name="cfbasemanhours"
                                           style='width: 90px;' type='text'
                                           value=''/>
                                </td>
                                <td align='center'>
                                    <input class='cfprice' style='width: 90px;' type='text'
                                           name='cfprice' value=''/>
                                </td>
                                <td name='notcheck' align='center'>
                                    <input class='cfqty' style='width: 90px;' type='text' name='cfqty' value=''/>
                                </td>
                                <td align='center'>
                                    <input class='cfamount' readonly="readonly" style='width: 90px;' type='text'
                                           name='cfamount' value=''/>
                                </td>
                                <td align='center'>
                                    <input class='cfallamount' readonly="readonly" style='width: 90px;' type='text'
                                           name='cfallamount'
                                           value=''/>
                                </td>
                                <td name='notcheck' align='center'>
                                    <input class='cfremark' style='width: 90px;' type='text' name='cfremark' value=''/>
                                </td>

                            </tr>
                        </table>

                    </div>
                    <div style="overflow:auto;width: 88%;margin-left: 90px;">
                        <table align="center" id="table2"
                               style="float:left;height:50px;overflow:scroll;border-spacing:0;margin-top: 20px; margin-left: 0px">
                            <tr>
                                <td><input type="text" readonly unselectable="on" value="合计" class="fseq"
                                           style="width: 30px; padding-right: 30px;"></td>
                                <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                <td><input style='width: 140px;' type="text" readonly unselectable="on"></td>
                                <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                <td><input class="sum1" style='width: 90px;' type="text" readonly unselectable="on">
                                </td>
                                <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                <td><input class="sum2" style='width: 90px;' type="text" value="0" readonly
                                           unselectable="on"></td>
                                <td><input style='width: 90px;' name="sum" id="sum" type="text" value="0" readonly
                                           unselectable="on"
                                           class="sum"></td>
                                <td><input style='width: 90px;' type="text" readonly unselectable="on"
                                           id="cfcash"></td>
                            </tr>
                        </table>
                    </div>

                    <div style="line-height:31px; margin-top: 80px; height: 31px;">
                        <div class="botton">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input id="shename" disabled='disabled' type="text" name="ffivouchered"
                                   value="">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                            <input id="createname" disabled='disabled' type="text" name="createName"
                                   value="${createName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input id="updatetime" disabled='disabled' type="text"
                                   name="fcreatetime"
                                   value="${recordin.fcreatetime}">
                        </div>
                    </div>

                    <div class="div_tj" style="margin-bottom: 200px;">
                        <div>
                            <input onclick="chcek()" class="input_submit bc" value="" type="button" style="margin-top: 0px;margin-right: 30px;">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""
                                   onclick="back()" style="margin-top: 0px;"/>
                        </div>
                    </div>
                </form>
            </div>

        </c:if>
        <!-- 修改页面-->
        <c:if test="${flag eq 2 }">
            <c:if test="${Carmaintain.cfbillstate == 3}">
                <div class="div_form">
                    <form id="update_shar" action="<%=path%>/DrivingSys/update_Carmaintain" onsubmit="StopRepeat()"
                          class="form" method="get">
                        <div class="div_input_hang">
                            <input type="hidden" name="fid" id="fid" value="${Carmaintain.fid}"/>
                            <div class="input_hang">
                                <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                                <input disabled='disabled' type="text" name="name" value="${department}"
                                       readonly="readonly"
                                       style="color: gray;"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                                <input type="text" id="fnumber" name="fnumber" value="${Carmaintain.fnumber}"
                                       style="color: gray;"
                                       readonly="readonly"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                                <input type="text" name="fbizdate" id="fbizdate_bind" value="${Carmaintain.fbizdate}"
                                       onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"/>
                                <img onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"
                                     src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">车辆&nbsp;:&nbsp;</span>
                                <input name="carName" class="carName is_click" onclick='clickcar($(this))'
                                       value="${Carmaintain.cfcarName}"/>
                                <input type="hidden" name="cfcarid" class="cfcarid" value="${Carmaintain.cfcarid}">
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                                <select name="cfbillstate">
                                    <option id="fdescriptionL2" style="color: gray;" value="3">保存</option>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">备注&nbsp;:&nbsp;</span>
                                <input name="fdescription" value="${Carmaintain.fdescription}"/>
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">部门&nbsp;:&nbsp;</span>
                                <input name="cfdepartmentName" class="is_click" onclick='clickdep($(this))'
                                       value="${Carmaintain.cfdepartmentName}"/>
                                <input type="hidden" name="cfdepartmentid" class="cfdepartmentid"
                                       value="${Carmaintain.cfdepartmentid}">
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">维修类型&nbsp;:&nbsp;</span>
                                <select name="cfmaintetype">
                                    <c:if test="${Carmaintain.cfmaintetype ==1}">
                                        <option style="color: gray;" value="1">正常维修</option>
                                    </c:if>
                                    <c:if test="${Carmaintain.cfmaintetype ==2}">
                                        <option style="color: gray;" value="2">事故维修</option>
                                    </c:if>
                                    <c:if test="${Carmaintain.cfmaintetype ==3}">
                                        <option style="color: gray;" value="3">公交车维修</option>
                                    </c:if>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">教练&nbsp;:&nbsp;</span>
                                <input name="jlname" class="jlName is_click" onclick="clickJlname($(this))"
                                       value="${Carmaintain.jlName}"/>
                                <input type="hidden" name="cfjiaolianid" class="cfcoachid"
                                       value="${Carmaintain.cfjiaolianid}">
                            </div>
                        </div>
                        <div style="width: 20%; margin-left: 90px; float: left">维修项目</div>
                        <div class="div_zilei" style="margin-left: 90px; float: left">
                            <div style="width: 60%;text-align: right;">
                                <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                                <span style="padding-right: 20px;color: #57a0ff;font-weight:700;font-size: 14px"
                                      class="addTable">添加</span>
                                <img src="<%=path%>/image/delete212.png" class="deleteTable">
                                <span class="deleteTable" style="color: #57a0ff;font-weight:700;font-size: 14px"
                                      class="deleteTable">删除</span>
                                <span style="cursor:pointer; padding-left: 40px;color: #57a0ff;font-weight:700;font-size: 14px"
                                      class="printTable" onclick="print_func()">打印</span>
                            </div>
                        </div>
                        <div style="overflow:auto;min-height: 274px;max-height: 274px;width: 88%;margin-left: 90px;">
                            <table id="tablejl" width="77%"
                                   style="min-height:50px; max-height:300px;border-spacing:0;white-space:nowrap;">
                                <tr class="tr">
                                    <td width="20px" align="center" style="padding-left: 5px"><%--<input type="checkbox"
                                                                                                     name="check"
                                                                                                     class="check"
                                                                                                     style="width: 15px;">--%>
                                    </td>
                                    <td width="30px">序号</td>
                                    <td align="center">维修项目</td>
                                    <td align="center">修理厂</td>
                                    <td align="center">工时</td>
                                    <td align="center">工时数量</td>
                                    <td align="center">工时金额</td>
                                    <td align="center">单价</td>
                                    <td align="center">数量</td>
                                    <td align="center">维修金额</td>
                                    <td align="center">合计</td>
                                    <td align="center">备注</td>
                                </tr>
                                <c:forEach items="${Carmaintain.carmaintainentryList}" var="carmaintainentry"
                                           varStatus="s">
                                    <tr>
                                        <td width='30px' align='center'>
                                            <input class='check2' type="checkbox" name="check2" style="width:15px">

                                        </td>
                                        <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                                   readonly="readonly"></td>

                                        <td style="position: relative;" name='notcheck' align='center'>
                                            <input class='cfmaintainitemName' style='width: 90px;' type='text'
                                                   name='cfmaintainitemName'
                                                   value='${carmaintainentry.cfmaintainitemName}'/>
                                            <input type="hidden" name="cfmaintainitemid" class="cfmaintainitemid"
                                                   value='${carmaintainentry.cfmaintainitemid}'>
                                            <img onclick="cfminame2($(this))"
                                                 style="cursor:pointer; width: 12px; height: 12px; position: absolute;right: 10px; top:10px;"
                                                 src="<%=path%>/images/index/details_img.png" alt="">
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfrepairshopName is_click' style='width: 140px;' type='text'
                                                   name='cfrepairshopName' onclick="clickrep($(this))"
                                                   value='${carmaintainentry.cfrepairshopName}'/>
                                            <input type="hidden" name="cfrepairshopid" class="cfrepairshopid"
                                                   value='${carmaintainentry.cfrepairshopid}'>
                                        </td>
                                        <td align='center'>
                                            <input style='width: 90px;' type='text'
                                                   class="cfmanhours"
                                                   name='cfmanhours'
                                                   value='${carmaintainentry.cfmanhours}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfgsqty' style='width: 90px;' type='text' name='cfgsqty'
                                                   value='${carmaintainentry.cfgsqty}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfbasemanhours' readonly="readonly" name="cfbasemanhours"
                                                   style='width: 90px;'
                                                   type='text'
                                                   value='${carmaintainentry.cfbasemanhours}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfprice' style='width: 90px;' type='text'
                                                   name='cfprice'
                                                   value='${carmaintainentry.cfprice}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfqty' style='width: 90px;' type='text'
                                                   name='cfqty'
                                                   value='${carmaintainentry.cfqty}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfamount' readonly="readonly" style='width: 90px;' type='text'
                                                   name='cfamount'
                                                   value='${carmaintainentry.cfamount}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfallamount' readonly="readonly" style='width: 90px;'
                                                   type='text'
                                                   name='cfallamount'
                                                   value='${carmaintainentry.cfallamount}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfremark' style='width: 90px;' type='text' name='cfremark'
                                                   value='${carmaintainentry.cfremark}'/>
                                        </td>

                                    </tr>
                                </c:forEach>
                            </table>

                        </div>
                        <div style="overflow:auto;width: 88%;margin-left: 90px;">
                            <table align="center" id="table2"
                                   style="float:left;height:50px;overflow:scroll;border-spacing:0;margin-top: 20px; margin-left: 0px">
                                <tr>
                                    <td><input type="text" readonly unselectable="on" value="合计" class="fseq"
                                               style="width: 30px; padding-right: 30px;"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 140px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input class="sum1" style='width: 90px;' type="text" readonly unselectable="on">
                                    </td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input class="sum2" style='width: 90px;' type="text" value="0" readonly
                                               unselectable="on"></td>
                                    <td><input style='width: 90px;' name="sum" id="sum" type="text" value="0" readonly
                                               unselectable="on"
                                               class="sum"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"
                                               id="cfcash"></td>
                                </tr>
                            </table>
                        </div>

                        <div style="line-height:31px; margin-top: 80px; height: 31px;">
                            <div class="botton">
                                <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                                <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                       value="${Carmaintain.checkName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                                <input id="createname" readonly="readonly" type="text" name="createName"
                                       value="${Carmaintain.createName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                                <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                       value="${Carmaintain.fcreatetime}">
                            </div>
                        </div>

                        <div class="div_tj">
                            <input type="hidden" id="auditstate" name="auditstate" value="${AuditState}">
                            <shiro:hasPermission name="/go_update_Carmaintain">
                                <div>
                                    <input type="button" class="input_submit bc" value="" onclick="audit(2)">
                                </div>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="/submitCarmaintain">
                                <div>
                                    <input type="button" class="input_submit tj" value="" onclick="submitTj()"/>
                                </div>
                            </shiro:hasPermission>
                                <%--<c:if test="${checkAuditState == 'true'}">--%>

                            <div>
                                <input type="button" class="input_submit cklc" value=""
                                       onclick="lookActivitiImg('${activitiBPMN_KEY}',$('#fnumber').val())"/>
                            </div>
                                <%--</c:if>--%>
                            <div>
                                <input type="button" class="input_back fh" value=""
                                       onclick="back()"/>
                            </div>
                        </div>
                    </form>
                </div>
            </c:if>
            <c:if test="${Carmaintain.cfbillstate == 4}">
                <div class="div_form">
                    <form id="update_shar" action="<%=path%>/DrivingSys/update_Carmaintain" class="form" method="get">
                        <div class="div_input_hang">
                            <input type="hidden" id="fid" name="fid" value="${Carmaintain.fid}"/>
                            <div class="input_hang">
                                <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                                <input disabled='disabled' type="text" name="name" value="${department}"
                                       readonly="readonly"
                                       style="color: gray;"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                                <input type="text" id="fnumber" name="fnumber" value="${Carmaintain.fnumber}"
                                       style="color: gray;"
                                       readonly="readonly"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                                <input type="text" name="fbizdate" id="fbizdate_bind" value="${Carmaintain.fbizdate}"
                                       readonly="readonly"/>
                                <img
                                        src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">车辆&nbsp;:&nbsp;</span>
                                <input name="carName" class="carName is_click" readonly="readonly"
                                       value="${Carmaintain.cfcarName}"/>
                                <input type="hidden" name="cfcarid" class="cfcarid" value="${Carmaintain.cfcarid}">
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                                <select name="cfbillstate">
                                    <option id="fdescriptionL2" style="color: gray;" value="4">提交</option>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">备注&nbsp;:&nbsp;</span>
                                <input name="fdescription" value="${Carmaintain.fdescription}" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">部门&nbsp;:&nbsp;</span>
                                <input name="cfdepartmentName" class="is_click" readonly="readonly"
                                       value="${Carmaintain.cfdepartmentName}"/>
                                <input type="hidden" name="cfdepartmentid" class="cfdepartmentid"
                                       value="${Carmaintain.cfdepartmentid}">

                            </div>
                            <div class="input_hang">
                                <span class="gn_name">维修类型&nbsp;:&nbsp;</span>
                                <select name="cfmaintetype">
                                    <c:if test="${Carmaintain.cfmaintetype ==1}">
                                        <option style="color: gray;" value="1">正常维修</option>
                                    </c:if>
                                    <c:if test="${Carmaintain.cfmaintetype ==2}">
                                        <option style="color: gray;" value="2">事故维修</option>
                                    </c:if>
                                    <c:if test="${Carmaintain.cfmaintetype ==3}">
                                        <option style="color: gray;" value="3">公交车维修</option>
                                    </c:if>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">教练&nbsp;:&nbsp;</span>
                                <input name="jlname" class="jlName is_click" readonly="readonly"
                                       value="${Carmaintain.jlName}"/>
                                <input type="hidden" name="cfjiaolianid" class="cfcoachid"
                                       value="${Carmaintain.cfjiaolianid}">
                            </div>
                        </div>
                        <div style="width:20%; margin-left: 90px; float: left">维修项目</div>
                        <div class="div_zilei" style="margin-left: 90px; float: left">
                            <span style="cursor:pointer; padding-left: 40px;color: #57a0ff;font-weight:700;font-size: 14px"
                                  class="printTable" onclick="print_func()">打印</span>
                        </div>
                        <div style="overflow:auto;min-height: 274px;max-height: 274px;width: 88%;margin-left: 90px;">
                            <table id="tablejl" width="77%"
                                   style="min-height:50px; max-height:300px;border-spacing:0;white-space:nowrap;">
                                <tr class="tr">
                                    <td width="20px" align="center" style="padding-left: 5px"><%--<input type="checkbox"
                                                                                                     name="check"
                                                                                                     class="check"
                                                                                                     style="width: 15px;">--%>
                                    </td>
                                    <td width="30px">序号</td>
                                    <td align="center">维修项目</td>
                                    <td align="center">修理厂</td>
                                    <td align="center">工时</td>
                                    <td align="center">工时数量</td>
                                    <td align="center">工时金额</td>
                                    <td align="center">单价</td>
                                    <td align="center">数量</td>
                                    <td align="center">维修金额</td>
                                    <td align="center">合计</td>
                                    <td align="center">备注</td>
                                </tr>
                                <c:forEach items="${Carmaintain.carmaintainentryList}" var="carmaintainentry"
                                           varStatus="s">
                                    <tr>
                                        <td width='30px' align='center'>
                                            <input class='check2' type="checkbox" name="check2" style="width:15px">

                                        </td>
                                        <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                                   readonly="readonly"></td>

                                        <td name='notcheck' align='center'>
                                            <input class='cfmaintainitemName is_click' style='width: 90px;' type='text'
                                                   name='cfmaintainitemName' readonly="readonly"
                                                   value='${carmaintainentry.cfmaintainitemName}'/>
                                            <input type="hidden" name="cfmaintainitemid" class="cfmaintainitemid"
                                                   value='${carmaintainentry.cfmaintainitemid}'>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfrepairshopName is_click' style='width: 140px;' type='text'
                                                   name='cfrepairshopName' readonly="readonly"
                                                   value='${carmaintainentry.cfrepairshopName}'/>
                                            <input type="hidden" name="cfrepairshopid" class="cfrepairshopid"
                                                   value='${carmaintainentry.cfrepairshopid}'>
                                        </td>
                                        <td align='center'>
                                            <input style='width: 90px;' readonly="readonly" type='text'
                                                   class="cfmanhours"
                                                   name='cfmanhours'
                                                   value='${carmaintainentry.cfmanhours}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfgsqty' style='width: 90px;' type='text' name='cfgsqty'
                                                   readonly="readonly"
                                                   value='${carmaintainentry.cfgsqty}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfbasemanhours' readonly="readonly" name="cfbasemanhours"
                                                   style='width: 90px;'
                                                   type='text'
                                                   value='${carmaintainentry.cfbasemanhours}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfprice' style='width: 90px;' type='text'
                                                   name='cfprice'
                                                   value='${carmaintainentry.cfprice}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfqty' readonly="readonly" style='width: 90px;' type='text'
                                                   name='cfqty'
                                                   value='${carmaintainentry.cfqty}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfamount' style='width: 90px;' type='text' name='cfamount'
                                                   readonly="readonly"
                                                   value='${carmaintainentry.cfamount}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfallamount' readonly="readonly" style='width: 90px;'
                                                   type='text'
                                                   name='cfallamount'
                                                   value='${carmaintainentry.cfallamount}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfremark' style='width: 90px;' type='text' name='cfremark'
                                                   readonly="readonly"
                                                   value='${carmaintainentry.cfremark}'/>
                                        </td>

                                    </tr>
                                </c:forEach>
                            </table>

                        </div>
                        <div style="overflow:auto;width: 88%;margin-left: 90px;">
                            <table align="center" id="table2"
                                   style="float:left;height:50px;overflow:scroll;border-spacing:0;margin-top: 20px; margin-left: 0px">
                                <tr>
                                    <td><input type="text" readonly unselectable="on" value="合计" class="fseq"
                                               style="width: 30px; padding-right: 30px;"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 140px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input class="sum1" style='width: 90px;' type="text" readonly unselectable="on">
                                    </td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input class="sum2" style='width: 90px;' type="text" value="0" readonly
                                               unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" value="0" readonly unselectable="on"
                                               class="sum"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"
                                               id="cfcash"></td>
                                </tr>
                            </table>
                        </div>

                        <div style="line-height:31px; margin-top: 80px; height: 31px;">
                            <div class="botton">
                                <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                                <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                       value="${Carmaintain.checkName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                                <input id="createname" readonly="readonly" type="text" name="createName"
                                       value="${Carmaintain.createName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                                <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                       value="${Carmaintain.fcreatetime}">
                            </div>
                        </div>

                        <div class="div_tj">

                            <c:if test="${AuditState == 'true'}">
                                <shiro:hasPermission name="/auditCarmaintain">
                                    <div>
                                        <input type="button" class="input_submit sh" value="" onclick="examine(5)"/>
                                    </div>
                                </shiro:hasPermission>
                            </c:if>
                            <shiro:hasPermission name="/againstAuditCarmaintain">
                                <div>
                                    <input type="button" class="input_submit fsh" value="" onclick="examine(3)">
                                </div>
                            </shiro:hasPermission>
                            <div>
                                <input type="button" class="input_submit cklc" value=""
                                       onclick="lookActivitiImg('${activitiBPMN_KEY}',$('#fnumber').val())"/>
                            </div>
                            <div>
                                <input type="button" class="input_back fh" value=""
                                       onclick="back()"/>
                            </div>
                        </div>
                    </form>
                </div>
            </c:if>
            <c:if test="${Carmaintain.cfbillstate == 5}">
                <div class="div_form">
                    <form id="update_shar" action="<%=path%>/DrivingSys/update_Carmaintain" class="form" method="get">
                        <div class="div_input_hang">
                            <input type="hidden" id="fid" name="fid" value="${Carmaintain.fid}"/>
                            <div class="input_hang">
                                <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                                <input disabled='disabled' type="text" name="name" value="${department}"
                                       readonly="readonly"
                                       style="color: gray;"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                                <input type="text" id="fnumber" name="fnumber" value="${Carmaintain.fnumber}"
                                       style="color: gray;"
                                       readonly="readonly"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                                <input type="text" name="fbizdate" id="fbizdate_bind" value="${Carmaintain.fbizdate}"
                                       readonly="readonly"/>
                                <img
                                        src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">车辆&nbsp;:&nbsp;</span>
                                <input name="carName" class="carName is_click" readonly="readonly"
                                       value="${Carmaintain.cfcarName}"/>
                                <input type="hidden" name="cfcarid" class="cfcarid" value="${Carmaintain.cfcarid}">
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                                <select name="cfbillstate">
                                    <option id="fdescriptionL2" style="color: gray;" value="5">审核</option>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">备注&nbsp;:&nbsp;</span>
                                <input name="fdescription" value="${Carmaintain.fdescription}" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">部门&nbsp;:&nbsp;</span>
                                <input name="cfdepartmentName" class="is_click" readonly="readonly"
                                       value="${Carmaintain.cfdepartmentName}"/>
                                <input type="hidden" name="cfdepartmentid" class="cfdepartmentid"
                                       value="${Carmaintain.cfdepartmentid}">

                            </div>
                            <div class="input_hang">
                                <span class="gn_name">维修类型&nbsp;:&nbsp;</span>
                                <select name="cfmaintetype">
                                    <c:if test="${Carmaintain.cfmaintetype ==1}">
                                        <option style="color: gray;" value="1">正常维修</option>
                                    </c:if>
                                    <c:if test="${Carmaintain.cfmaintetype ==2}">
                                        <option style="color: gray;" value="2">事故维修</option>
                                    </c:if>
                                    <c:if test="${Carmaintain.cfmaintetype ==3}">
                                        <option style="color: gray;" value="3">公交车维修</option>
                                    </c:if>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">教练&nbsp;:&nbsp;</span>
                                <input name="jlname" class="jlName is_click" readonly="readonly"
                                       value="${Carmaintain.jlName}"/>
                                <input type="hidden" name="cfjiaolianid" class="cfcoachid"
                                       value="${Carmaintain.cfjiaolianid}">
                            </div>
                        </div>
                        <div style="width: 100%; margin-left: 90px; float: left">维修项目</div>
                        <div class="div_zilei" style="margin-left: 90px; float: left">
                                    <span style=" cursor:pointer; padding-left: 900px;color: #57a0ff;font-weight:700;font-size: 14px"
                                          class="printTable" onclick="print_func()">打印</span>
                        </div>
                        <div style="overflow:auto;min-height: 274px;max-height: 274px;width: 88%;margin-left: 90px;">
                            <table id="tablejl" width="77%"
                                   style="min-height:50px; max-height:300px;border-spacing:0;white-space:nowrap;">
                                <tr class="tr">
                                    <td width="20px" align="center" style="padding-left: 5px"><%--<input type="checkbox"
                                                                                                     name="check"
                                                                                                     class="check"
                                                                                                     style="width: 15px;">--%>
                                    </td>
                                    <td width="30px">序号</td>
                                    <td align="center">维修项目</td>
                                    <td align="center">修理厂</td>
                                    <td align="center">工时</td>
                                    <td align="center">工时数量</td>
                                    <td align="center">工时金额</td>
                                    <td align="center">单价</td>
                                    <td align="center">数量</td>
                                    <td align="center">维修金额</td>
                                    <td align="center">合计</td>
                                    <td align="center">备注</td>
                                </tr>
                                <c:forEach items="${Carmaintain.carmaintainentryList}" var="carmaintainentry"
                                           varStatus="s">
                                    <tr>
                                        <td width='30px' align='center'>
                                            <input class='check2' type="checkbox" name="check2" style="width:15px">

                                        </td>
                                        <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                                   readonly="readonly"></td>

                                        <td name='notcheck' align='center'>
                                            <input class='cfmaintainitemName is_click' style='width: 90px;' type='text'
                                                   name='cfmaintainitemName' readonly="readonly"
                                                   value='${carmaintainentry.cfmaintainitemName}'/>
                                            <input type="hidden" name="cfmaintainitemid" class="cfmaintainitemid"
                                                   value='${carmaintainentry.cfmaintainitemid}'>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfrepairshopName is_click' style='width: 140px;' type='text'
                                                   name='cfrepairshopName' readonly="readonly"
                                                   value='${carmaintainentry.cfrepairshopName}'/>
                                            <input type="hidden" name="cfrepairshopid" class="cfrepairshopid"
                                                   value='${carmaintainentry.cfrepairshopid}'>
                                        </td>
                                        <td align='center'>
                                            <input style='width: 90px;' readonly="readonly" type='text'
                                                   class="cfmanhours"
                                                   name='cfmanhours'
                                                   value='${carmaintainentry.cfmanhours}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfgsqty' style='width: 90px;' type='text' name='cfgsqty'
                                                   readonly="readonly"
                                                   value='${carmaintainentry.cfgsqty}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfbasemanhours' readonly="readonly" name="cfbasemanhours"
                                                   style='width: 90px;'
                                                   type='text'
                                                   value='${carmaintainentry.cfbasemanhours}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfprice' style='width: 90px;' type='text'
                                                   name='cfprice'
                                                   value='${carmaintainentry.cfprice}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfqty' readonly="readonly" style='width: 90px;' type='text'
                                                   name='cfqty'
                                                   value='${carmaintainentry.cfqty}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfamount' style='width: 90px;' type='text' name='cfamount'
                                                   readonly="readonly"
                                                   value='${carmaintainentry.cfamount}'/>
                                        </td>
                                        <td align='center'>
                                            <input class='cfallamount' readonly="readonly" style='width: 90px;'
                                                   type='text'
                                                   name='cfallamount'
                                                   value='${carmaintainentry.cfallamount}'/>
                                        </td>
                                        <td name='notcheck' align='center'>
                                            <input class='cfremark' style='width: 90px;' type='text' name='cfremark'
                                                   readonly="readonly"
                                                   value='${carmaintainentry.cfremark}'/>
                                        </td>

                                    </tr>
                                </c:forEach>
                            </table>

                        </div>
                        <div style="overflow:auto;width: 88%;margin-left: 90px;">
                            <table align="center" id="table2"
                                   style="float:left;height:50px;overflow:scroll;border-spacing:0;margin-top: 20px; margin-left: 0px">
                                <tr>
                                    <td><input type="text" readonly unselectable="on" value="合计" class="fseq"
                                               style="width: 30px; padding-right: 30px;"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 140px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input class="sum1" style='width: 90px;' type="text" readonly unselectable="on">
                                    </td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"></td>
                                    <td><input class="sum2" style='width: 90px;' type="text" value="0" readonly
                                               unselectable="on"></td>
                                    <td><input style='width: 90px;' name="sum" id="sum" type="text" value="0" readonly
                                               unselectable="on"
                                               class="sum"></td>
                                    <td><input style='width: 90px;' type="text" readonly unselectable="on"
                                               id="cfcash"></td>
                                </tr>
                            </table>
                        </div>

                        <div style="line-height:31px; margin-top: 80px; height: 31px;">
                            <div class="botton">
                                <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                                <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                       value="${Carmaintain.checkName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                                <input id="createname" readonly="readonly" type="text" name="createName"
                                       value="${Carmaintain.createName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                                <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                       value="${Carmaintain.fcreatetime}">
                            </div>
                        </div>

                        <div class="div_tj">
                            <shiro:hasPermission name="/againstAuditCarmaintain">
                                <div>
                                    <input type="button" class="input_submit fsh" value="" onclick="examine(3)">
                                </div>
                            </shiro:hasPermission>
                            <div>
                                <input type="button" class="input_submit cklc" value=""
                                       onclick="lookActivitiImg('${activitiBPMN_KEY}',$('#fnumber').val())"/>
                            </div>
                            <div>
                                <input type="button" class="input_back fh" value=""
                                       onclick="back()"/>
                            </div>
                        </div>
                    </form>
                </div>
            </c:if>
        </c:if>
        <input id="AuditState" name="AuditState" id="auditstate" type="hidden" value="${AuditState}">
    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=path%>/JQuery/jquery.cookie.js"></script>
<script type="text/javascript" src="<%=path%>/common/print/jQuery.print.min.js"></script>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript" src="<%=path%>/JS/tempJs/tool.js"></script>
<script type="text/javascript">

    /*计算打印的内容*/
    $(document).ready(function () {
        $('#dy_cfqty').text(class_sum('.dy_cfqty'));
        $('#dy_cfprice').text(class_sum('.dy_cfprice'));
        $('#dy_cfamount').text(class_sum('.dy_cfamount'));
        $('#dy_cfgsqty').text(class_sum('.dy_cfgsqty'));
        $('#dy_cfmanhours').text(class_sum('.dy_cfmanhours'));
        $('#dy_cfbasemanhours').text(class_sum('.dy_cfbasemanhours'));
        $('#dy_cfallamount').text(class_sum('.dy_cfallamount'));

    });

    /*打印*/
    function print_func() {
        /*var aa = $('.trainChargeTable').find('tr:eq(0)').find('td:eq(2)').text();
    alert(aa);
    return;
    debugger;*/
        $('.content_id').css('display', 'block');
        $('.content_id').print({
            //是否读取页面的样式
            globalStyles: true,
            //添加与attrbute media=打印的链接。
            mediaPrint: false,
            //在隐藏的iframe中打印。
            iframe: false,
            //不打印 的内容（选择器）
            noPrintSelector: ".avoid-this",
            //Add this at top
            prepend: "Hello World!!!<br/>",
            //Add this on bottom
            append: "<br/>Buh Bye!",
            //Log to console when printing is done via a deffered callback
            deferred: $.Deferred().done(function () {
                console.log('Printing done', arguments);
            })
        });
        $('.content_id').css('display', 'none');
        //$.print("#print-table-id");
    }


    var _state;

    //改变审核状态
    function audit(state) {
        //改变单据状态
        $("#fdescriptionL2").val(state);
        //写入审核人标记
        $("#shename").val(state);
        if ($('#update_shar').find("tr").length == 1) {
            alert('请至少选择一条数据！')
            return false;
        }
        $('#update_shar').submit()
    }

    //改变复选框的值
    function chcek() {
        if ($('#update_shar').find("tr").length == 1) {
            alert('请至少选择一条数据！')
            return false;
        }
        $('#update_shar').submit()
    }

    function submitTj() {

        $.messager.confirm('提示', '是否提交,提交后不会改变修改后的值', function (r) {

            if (r) {
                $.ajax({
                    url: '<%=path%>/DrivingSys/queryCarmaintainSubmit',
                    type: "post",
                    data: {
                        'fid': $('#fid').val(),
                        'fnumber': $('#fnumber').val(),
                        'auditstate': $('#auditstate').val(),
                        'cfdepartmentid': $('.cfdepartmentid').val(),
                        'sum': $('#sum').val()

                    },
                    dataType: "json",
                    success: function (res) {
                        showAlert(res.msg, 'queryCarmaintain/look.action?state=first');
                    },
                    error: function () {
                        alert('错误');
                    }
                })
            }
        });

    }


    $('#auditsubmit').click(function () {
        $('.auditcheck').each(function () {
            if ($(this).is(':checked')) {
                $.ajax({
                    url: '<%=path%>/DrivingSys/queryCarmaintainExamine',
                    type: "post",
                    data: {
                        'fid': $('#fid').val(),
                        'state': _state,
                        'fnumber': $('#fnumber').val(),
                        'agreed': $(this).val(),
                        'auditcomment': $('#auditcomment').val()
                    },
                    dataType: "json",
                    success: function (res) {
                        showAlert(res.msg, 'queryCarmaintain/look.action?state=first');
                    },
                    error: function () {
                        alert('错误');
                    }
                })
            } else {

            }
        })
    })
    //反审核按钮
    $('#againstAuditsubmit').click(function () {
        $.ajax({
            url: '<%=path%>/DrivingSys/queryCarmaintainExamine',
            type: "post",
            data: {
                'fid': $('#fid').val(),
                'state': _state,
                'fnumber': $('#fnumber').val(),
                'auditcomment': $('#againstAuditcomment').val(),
                'AuditState': $('#AuditState').val()

            },
            dataType: "json",
            success: function (res) {
                showAlert(res.msg, 'queryCarmaintain/look.action?state=first');
            },
            error: function () {
                alert('错误');
            }
        })
    })

    function examine(state) {
        _state = state;
        if (state == 5) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data9').css('visibility', 'visible')
        }
        else if (state == 3) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data10').css('visibility', 'visible')
        }
    }


    $('.addTable').click(function () {
        fseq = CalculateMaxNum('tablejl')
        var htmlperson = "<tr> " +
            "<td width='30px' align='center'> <input class='check2' type='checkbox' name='check2' style='width:15px'> </td> " +
            " <td><input type='text' class='fseq' name='fseq' value='" + fseq + "' readonly='readonly'></td>" +
            " <td style='position: relative;' name='notcheck' align='center'> " +
            "        <input class='cfmaintainitemName' style='width: 90px;' type='text' " +
            "    name='cfmaintainitemName' value=''/> " +
            "        <input type='hidden' name='cfmaintainitemid' class='cfmaintainitemid'> " +
            "        <img onclick='cfminame2($(this))'  style='cursor:pointer; width: 12px; height: 12px; position: absolute;right: 10px; top:10px;' src='<%=path%>/images/index/details_img.png' alt=''> " +
            "        </td>" +
            " <td name='notcheck' align='center'> <input class='cfrepairshopName is_click' style='width: 140px;' type='text'name='cfrepairshopName' onclick='clickrep($(this))' value=''/>" +
            " <input type='hidden' name='cfrepairshopid' class='cfrepairshopid'> </td> " +
            "<td align='center'> <input style='width: 90px;' readonly='readonly' type='text' class='cfmanhours' name='cfmanhours' value='0'/> " +
            "</td> <td name='notcheck' align='center'> <input class='cfgsqty' style='width: 90px;' type='text' name='cfgsqty' value=''/> </td> " +
            "<td name='notcheck' align='center'> <input class='cfbasemanhours' readonly='readonly' name='cfbasemanhours' style='width: 90px;' type='text'value=''/> </td> " +
            "<td  align='center'> <input class='cfprice' style='width: 90px;' type='text'  name='cfprice' value=''/> </td> " +
            "<td name='notcheck' align='center'> <input class='cfqty' style='width: 90px;' type='text' name='cfqty' value=''/> </td> " +
            "<td align='center'> <input class='cfamount' style='width: 90px;' type='text' readonly='readonly' name='cfamount' value=''/> </td> " +
            "<td align='center'> <input class='cfallamount' style='width: 90px;' type='text' readonly='readonly' name='cfallamount'value=''/> </td> " +
            "<td name='notcheck' align='center'> <input class='cfremark' style='width: 90px;' type='text' name='cfremark' value=''/> </td> " +
            "</tr>";
        $("#tablejl").append(htmlperson)
    })

    //弹出模式框教练信息
    function clickJlname(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data1').css('visibility', 'visible')
        $('.data1-checkbox:checkbox').removeAttr('checked');
        $('.page').show();
        _this = e.parent().parent();
    }

    //弹出车辆信息
    function clickcar(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data5').css('visibility', 'visible')
        $('.data5-checkbox:checkbox').removeAttr('checked');
        _this = e.parent().parent();
    }

    //弹出部门
    function clickdep(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data6').css('visibility', 'visible')
        $('.data6-checkbox:checkbox').removeAttr('checked');
        _this = e.parent();
    }

    var tm = "";

    //维修项目弹窗
    function cfminame2(e) {
        var jx = e.parent().parent().prop("class");
        var name="";

      //获取所有新加学员名称
        $('input:text[name=cfmaintainitemName]').each(function (i) {
            name = $(this).val();

        });
        $(".stu").val(jx)
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data7').css('visibility', 'visible')

        _this = e.parent().parent();

        //反复查询
            $('.cfmList').html("<div class='loading'></div>");
            $.ajax({
                url: '<%=path7%>/DrivingSys/selMaintainItems',
                type: "post",
                data: {'name': name},
                dataType: "json",
                success: function (json) {

                    $('.cfmList').html(myTemplatecfm(json));
                    tm = "tm";
                    $('.cfbasemanhours').val('0')
                    $('.cfamount').val('0')
                    $('.cfallamount').val('0')
                    coment();
                },
                error: function () {
                    alert('错误');
                }
            })

    }

    //修理厂
    function clickrep(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data8').css('visibility', 'visible')

        _this = e.parent().parent();

        $('.repList').html("<div class='loading'></div>");
        $.ajax({
            url: '<%=path7%>/DrivingSys/select_RepairShop',
            type: "post",
            data: {},
            dataType: "json",
            success: function (json) {
                $('.repList').html(myTemplaterep(json));
            },
            error: function () {
                alert('错误');
            }
        })
    }

    /* 关闭弹出框    */
    $('.btn').click(function () {
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data1').css('visibility', 'hidden')
        $('.data1-checkbox:checkbox').removeAttr('checked');
        $('.modal-data7').css('visibility', 'hidden')
        $('.data7-checkbox:checkbox').removeAttr('checked');
        $('.modal-data5').css('visibility', 'hidden')
        $('.data5-checkbox:checkbox').removeAttr('checked');
        $('.modal-data6').css('visibility', 'hidden')
        $('.data6 -checkbox:checkbox').removeAttr('checked');
        $('.modal-data8').css('visibility', 'hidden')
        $('.data8-checkbox:checkbox').removeAttr('checked');
        $('.modal-data9').css('visibility', 'hidden')
        $('.page').hide();
    })

    //设置全选功选
    $('.check').click(function () {
        if ($(this).attr("checked")) {
            $(".check2:checkbox").prop("checked", true)
        } else {
            $('.check2:checkbox').removeAttr('checked')
        }
    })
    //由于和input:checkbox冲突，在选择一次
    $("#tablejl tr td .check2:checkbox").live('click', function () {
        if ($(this).is('.check2:checked')) {
            $(this).removeAttr("checked");
        } else {
            $(this).attr("checked", ".check2:checked")
        }
    })
    //单击选中
    $("#tablejl tr td").live('click', function () {
        if ($(this).parent().find(".check2:checkbox").is(':checked')) {
            $(this).parent().find(".check2:checkbox").removeAttr("checked");
        } else {
            $(this).parent().find(".check2:checkbox").attr("checked", ":checked")
        }
    })

    //选中的删除
    $(".deleteTable").click(function () {
        var tr_len = $("#tablejl tr").length;
        var s = '';
        $('input:checkbox[name=check2]').each(function (i) {

            if ($(this).is('.check2:checked')) {

                $(this).parent().parent().remove();
                s = '1';
                reorder()
            }
        })
        coment();

        //判断是否选中
        if (s == null || s == '') {
            alert("请选择一条数据删除");
            return false;
        }
    })

    //把选中的教练信息名称填充到输入框中
    $('#subtn1').click(function () {
        var spCodesTemp = "";
        $('input:checkbox[name=personfid]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });
        if (spCodesTemp == "") {
            alert('请选择教练信息！');
            return false;
        }

        $.ajax({
            url: '<%=path%>/DrivingSys/selectPersonByFidAsPage',
            type: "post",
            data: {'id': spCodesTemp},
            dataType: "json",
            success: function (res) {

                _this.find('input[class=cfcoachid]').prev().val(res[0].jlname);
                _this.find('input[class=cfcoachid]').val(res[0].fid);

                //回填部门 cfpersondepName
                var cfdepartmentid = $('.cfdepartmentid')
                alert(res[0].cfpersondepName)
                cfdepartmentid.prev().val(res[0].cfpersondepName)
                cfdepartmentid.val(res[0].cfpersondepid)
                //回填车辆(现在暂时不需要回填)
                $('.carName').val(res[0].cfcarnumber)
                $('.cfcarid').val(res[0].carid)


                $('#modal-overlay').css('visibility', 'hidden')
                $('.modal-data1').css('visibility', 'hidden')
            },
            error: function () {
                alert('Error');
            }
        });

    });

    //车辆
    $('#subtn5').click(function () {

        var car = $('input:checkbox[name=train]:checked').parent()

        if (car.val() != "") {
            alert('请选择车辆信息！');
            return false;
        }

        _this.children().children('input[class=cfcarid]').prev().val(car.next().next().html());
        _this.children().children('input[class=cfcarid]').val($('input:checkbox[name=train]:checked').val());
        _this.children().children('input[class=cfcarno]').val(car.next().next().html());
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data5').css('visibility', 'hidden')
        $('input:checkbox[name=train]:checked').removeAttr("checked");

    });

    //部门
    $('#subtn6').click(function () {

        var dep = $('input:checkbox[name=train3]:checked').parent()

        if (dep.val() != "") {
            alert('请选择部门信息！');
            return false;
        }

        /*_this.children().children('input[class=carName]').val(car.next().html());
         _this.children().children('input[class=cfcarid]').val($('input:checkbox[name=train]:checked').val());
         _this.children().children('input[class=cfcarno]').val(car.next().next().html());*/
        _this.children().next().val(dep.next().next().html());
        _this.children().next().next().val($('input:checkbox[name=train3]:checked').val());
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data6').css('visibility', 'hidden')
        $('input:checkbox[name=train3]:checked').removeAttr("checked");

    });

    //维修项目
    $('#subtn7').click(function () {

        var data = $('input:checkbox[name=train2]:checked').parent()

        if (data.val() != "") {
            alert('请选择维修项目信息！');
            return false;
        }

        _this.children().children('input[class=cfmaintainitemid]').val($('input:checkbox[name=train2]:checked').val())
        _this.children().children('input[class=cfmaintainitemid]').prev().val(data.next().html())

        _this.children().children('input[class=cfmanhours]').val(data.next().next().next().next().next().next().next().next().next().next().next().html())
        _this.children().children('input[class=cfprice]').val(data.next().next().next().next().next().next().next().next().next().next().html())
        _this.children().children('input[class=cfqty]').val(0)

        //重置金额
        _this.children().children('input[class=cfgsqty]').val(0)
        _this.children().children('input[class=cfbasemanhours]').val(0)
        _this.children().children('input[class=cfamount]').val(0)
        _this.children().children('input[class=cfallamount]').val(0)

        coment()
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data7').css('visibility', 'hidden')
        $('input:checkbox[name=train2]:checked').removeAttr("checked");

    });

    //修理厂
    $('#subtn8').click(function () {

        var data = $('input:checkbox[name=train3]:checked').parent()
        if (data.val() != "") {
            alert('请选择修理厂信息！');
            return false;
        }
        _this.children().children('input[class=cfrepairshopid]').val($('input:checkbox[name=train3]:checked').val())
        _this.children().children('input[class=cfrepairshopid]').prev().val(data.next().html())

        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data8').css('visibility', 'hidden')
        $('input:checkbox[name=train2]:checked').removeAttr("checked");

    });

    $(document).on('keyup', '.cflcts', function (event) {
        //最后一位是小数点的话，移除
        var $amountInput = $(this);
        //响应鼠标事件，允许左右方向键移动
        event = window.event || event;
        if (event.keyCode == 37 | event.keyCode == 39) {
            return;
        }
        var clazz = $(this).prop("class")
        //获取输入框的值
        var value = $(this).val();
        //判断负数是否在第一位
        if (value.substring(0, 1) == '-') {

        }
        if (value.length == 0) {
            $(this).val("0")
        }
        if (value.lastIndexOf('0') == 0) {
            $(this).val(value.substring(1, value.length))
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //判断负数不是在第一位，替换
        if (value.lastIndexOf('-') >= 0) {
            $(this).val("0")
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //先把非数字的都替换掉，除了数字和.
        $amountInput.val($amountInput.val().replace(/[^\-?\d]/g, "").//只允许一个小数点
        replace(/^\./g, "").replace(/\.{2,}/g, ".").//只能输入小数点后两位
        replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
        if ($(this).val() == "") {
            $(this).val(0)
        }
    });
    $(document).on('keyup', '.cfmanhours', function (event) {
        //最后一位是小数点的话，移除
//        var $amountInput = $(this);
        //响应鼠标事件，允许左右方向键移动
        event = window.event || event;
        if (event.keyCode == 37 | event.keyCode == 39) {
            return;
        }
        var clazz = $(this).prop("class")
        //获取输入框的值
        var value = $(this).val();
        //判断负数是否在第一位
        if (value.substring(0, 1) == '-') {

        }
        if (value.length == 0) {
            $(this).val("0")
        }
        if (value.lastIndexOf('0') == 0) {
            $(this).val(value.substring(1, value.length))
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //判断负数不是在第一位，替换
        if (value.lastIndexOf('-') >= 0) {
            $(this).val("0")
            // $amountInput.val($amountInput.val().replace('-','')
        }

        //先把非数字的都替换掉，除了数字和.
//        $amountInput.val($amountInput.val().replace(/[^\-?\d]/g, "").//只允许一个小数点
//        replace(/^\./g, "").replace(/\.{2,}/g, ".").//只能输入小数点后两位
//        replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));

        if ($(this).val() == "") {
            $(this).val(0)
        }
    });

    $(document).on('keyup', '.cfqty', function (event) {
        //最后一位是小数点的话，移除
        var $amountInput = $(this);
        //响应鼠标事件，允许左右方向键移动
        event = window.event || event;
        if (event.keyCode == 37 | event.keyCode == 39) {
            return;
        }
        var clazz = $(this).prop("class")
        //获取输入框的值
        var value = $(this).val();
        //判断负数是否在第一位
        if (value.substring(0, 1) == '-') {

        }
        if (value.length == 0) {
            $(this).val("0")
        }
        if (value.lastIndexOf('0') == 0) {
            $(this).val(value.substring(1, value.length))
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //判断负数不是在第一位，替换
        if (value.lastIndexOf('-') >= 0) {
            $(this).val("0")
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //先把非数字的都替换掉，除了数字和.
        $amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").//只允许一个小数点
        replace(/^\./g, "").replace(/\.{2,}/g, ".").//只能输入小数点后两位
        replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
        if ($(this).val() == "") {
            $(this).val(0)
        }
    });
    $(document).on('keyup', '.cfgsqty', function (event) {
        //最后一位是小数点的话，移除
        var $amountInput = $(this);
        //响应鼠标事件，允许左右方向键移动
        event = window.event || event;
        if (event.keyCode == 37 | event.keyCode == 39) {
            return;
        }
        var clazz = $(this).prop("class")
        //获取输入框的值
        var value = $(this).val();
        //判断负数是否在第一位
        if (value.substring(0, 1) == '-') {

        }
        if (value.length == 0) {
            $(this).val("0")
        }
        if (value.lastIndexOf('0') == 0) {
            $(this).val(value.substring(1, value.length))
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //判断负数不是在第一位，替换
        if (value.lastIndexOf('-') >= 0) {
            $(this).val("0")
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //先把非数字的都替换掉，除了数字和.
        $amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").//只允许一个小数点
        replace(/^\./g, "").replace(/\.{2,}/g, ".").//只能输入小数点后两位
        replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
        if ($(this).val() == "") {
            $(this).val(0)
        }
    });

    $(document).on('keyup', '.cfqty,.cfgsqty', function (event) {
        var _this = $(this).parent().parent();
        var sum = 0;

        var cfgsqty = _this.find('input[name=cfgsqty]').val().replace(/\D|^0/g, '');//工时数量
        var cfqty = _this.find('input[name=cfqty]').val().replace(/\D|^0/g, '');//数量

        var cfmanhours = _this.find('input[name=cfmanhours]').val()//工时
        var cfprice = _this.find('input[name=cfprice]').val()//单价

        if (cfgsqty == "") {
            cfgsqty = 0;
        }
        if (cfqty == "") {
            cfqty = 0;
        }


        var cfbasemanhours = cfgsqty * cfmanhours;//工时金额总计
        var cfamounts = cfqty * cfprice;//维修金额
        _this.find('input[name=cfbasemanhours]').val(cfbasemanhours)
        _this.find('input[name=cfamount]').val(cfamounts)

        _this.find('input[name=cfallamount]').val(cfbasemanhours * 1 + cfamounts * 1);//总计

        coment();
    });

    window.onload = function () {
        var _this = $(this).parent().parent();
        var sum = 0;

        var cfgsqty = _this.find('input[name=cfgsqty]').val()//工时数量
        var cfqty = _this.find('input[name=cfqty]').val()//数量

        var cfmanhours = _this.find('input[name=cfmanhours]').val()//工时
        var cfprice = _this.find('input[name=cfprice]').val()//单价

        if (cfgsqty == "") {
            cfgsqty = 0;
        }
        if (cfqty == "") {
            cfqty = 0;
        }


        var cfbasemanhours = cfgsqty * cfmanhours;//工时金额总计
        var cfamounts = cfqty * cfprice;//维修金额
        _this.find('input[name=cfbasemanhours]').val(cfbasemanhours)
        _this.find('input[name=cfamount]').val(cfamounts)

        _this.find('input[name=cfallamount]').val(cfbasemanhours * 1 + cfamounts * 1);//总计

        coment();
    };

    function coment() {
        var sum = 0;
        $('.cfallamount').each(function (i) {
            var count=$(this).val();

            sum += (Math.round(count*100)/100)
        })
         sum=Math.round(sum*100)/100
        $('.sum').val(sum)
        sum = 0;
        $('.cfbasemanhours').each(function (i) {
            sum += ($(this).val()) * 1
        })
        $('.sum1').val(sum)
        sum = 0;
        $('.cfamount').each(function (i) {
            sum += ($(this).val()) * 1
        })
        $('.sum2').val(sum)
    }

    $('.copyDate').click(function () {
        var cfrepairshopName = $('.cfrepairshopName').val()
        var cfrepairshopid = $('.cfrepairshopid').val()

        $('.cfrepairshopName').each(function (i) {
            $(this).val(cfrepairshopName);
        })

        $('.cfrepairshopid').each(function (i) {
            $(this).val(cfrepairshopid);
        })
    })
    //返回
    function back()
    {
        parent.closeSelectCard()
    }
</script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
</html>